<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>叶琪</title>
    <style>
        div.ex{
         width: 220px;
         padding: 10px;
         border: 5px solid gray;
         margin: 0px;
        }
    </style>
</head>
<body>
    <img src="img/250x250px.gif" width="250" height="250" />

<div class="ex">上面的图片是250 px宽。
这个元素的总宽度也是250 px。</div>
</body>
</html>